<?php
require_once "INews.php";

class NewsProxy implements INews
{
    private $newsObject;

    /**
     * 构造函数
     * @param Inews $news
     */
    function __construct(Inews $news)
    {
        $this->newsObject = $news;
    }
    public function editNews(int $newsId)
    {
        $this->preInvoke();
        $this->newsObject->editNews($newsId);
        $this->afterInvoke();
    }
    public function delNews(int $newsId)
    {
        $this->preInvoke();
        $this->newsObject->delNews($newsId);
        $this->afterInvoke();
    }
    private function preInvoke(){
        echo "执行前判断";
    }
    private function afterInvoke()
    {
        echo "执行后判断";
    }
}